/**
 * @author liangxi
 * @since 2023/12/21
 */

#ifndef DESIGNPATTERN_DUCKADAPTER_H
#define DESIGNPATTERN_DUCKADAPTER_H

#include <memory>
#include <iostream>
#include "../Turkey.h"
#include "../../Duck/Duck.h"

namespace Adapter {

    class DuckAdapter : public Adapter::Turkey {
    private:
        std::shared_ptr<Adapter::Duck> duck;
    public:

        explicit DuckAdapter(const std::shared_ptr<Duck> &duck) : duck(duck) {}

        void gobble() override {
            duck->quack();
        }


        void fly() override {
            duck->fly();
            std::cout << "but a little..." << std::endl;
        }
    };

} // Adapter

#endif //DESIGNPATTERN_DUCKADAPTER_H
